{% extends 'base/searchbasehead.html' %}
{% block title %}
    首页
{% endblock %}
{% block content %}
    {% for foo in data %}
        <div class="row" id="{{ foo.id }}">
            <div class="col-md-2">
                <button type="button" value="{{ foo.id }}" name="del" class="btn btn-danger">删除</button>
            </div>
            <div class="col-md-10">
                <div class="card">
                    <div class="card-header">
                        {{ foo.word }}
                    </div>
                    <div class="card-body">
                        <blockquote class="blockquote mb-0">
                            <p>{{ foo.mean }}</p>
                            <footer class="blockquote-footer"><cite title="Source Title">{{ foo.title }}</cite></footer>
                        </blockquote>
                    </div>
                </div>
            </div>
        </div>
    {% endfor %}
{% endblock %}
{% block js %}
    <script type="text/javascript">
        $(document).ready(function () {
            $('[name="del"]').click(function (e) {
                t = e.target.value;
                $('#' + t).hide();
                $.ajax({
                    type: "get",
                    url: '{% url "delword" %}',
                    data: {"wordid": e.target.value,},
                    dataType: "json",
                    success: function (mes) {



                    }
                });
            })

        })
    </script>
{% endblock %}